Skip to content

SplatPager: null texture source to ensure underlying arrays can be GC'ed#326

Merged
dmarcos merged 1 commit into
sparkjsdev:mainfrom
mrxz:fix-dispose-pager
May 2, 2026
Merged

SplatPager: null texture source to ensure underlying arrays can be GC'ed#326
dmarcos merged 1 commit into
sparkjsdev:mainfrom
mrxz:fix-dispose-pager

Conversation

@mrxz
Copy link
Copy Markdown
Collaborator

@mrxz mrxz commented Apr 28, 2026

Alternative PR to #320 that nulls the texture source data. This removes all references to the underlying TypedArrays instead of only clearing the reference from SplatPager -> Texture. Since these textures are also referenced from (cached) shader materials, this avoids having to hunt them down manually.

Ultimately it's still a crude approach, but at least ensures no large memory leaks occur. A proper solution would be to ensure that the cached shader materials are disposed of. This way no references to the textures should remain, allowing them to GC'ed normally.

Co-authored-by: Aleksandr Korotaev <lekzd@mail.ru>
@lekzd
Copy link
Copy Markdown
Contributor

lekzd commented Apr 30, 2026

@mrxz I confirm it fixes biggest memory leak

@dmarcos dmarcos merged commit 281cd7c into sparkjsdev:main May 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants